package service.impl;

import dao.impl.CartDAOImpl;
import model.Trolley;
import service.BaseService;

import java.util.List;

public class CartServiceImpl implements BaseService, service.CartService {
    private CartDAOImpl cartDAO;

    public CartServiceImpl() {
        cartDAO = new CartDAOImpl();
    }

    @Override
    public List<Trolley> getTrolleyById(String id) {

        return cartDAO.getTrolleyById(id);
    }

    @Override
    public int updateTrolley(Trolley trolley) {
        return cartDAO.updateTrolley(trolley);
    }

    @Override
    public void deleteTrolleyAll(String userID) {
        cartDAO.deleteTrolleyAll(userID);
    }

    @Override
    public void deleteTrolley(String userid, String goodsid) {
        cartDAO.deleteTrolley(userid, goodsid);
    }

    @Override
    public int addTrolley(Trolley trolley) {
        return cartDAO.addTrolley(trolley);
    }

    @Override
    public List<Trolley> getAllTrolley() {
        return cartDAO.getAllTrolley();
    }
}
